#include <cstdio>
int main(){
    int T,k;
    scanf("%d%d",&T,&k);
    int n1,b,t,n2;
    for(int i=0;i<k;i++){
        scanf("%d%d%d%d",&n1,&b,&t,&n2);
        if(t>T){
            printf("Not enough tokens.  Total = %d.\n",T);
            continue;
        }
        if((n2>n1&&b==1)||(n2<n1&&b==0)){
            T+=t;
            printf("Win %d!  Total = %d.\n",t,T);
        }
        else{
            T-=t;
            if(T<=0){
                printf("Lose %d.  Total = 0.\n",t);
                printf("Game Over.\n");
                break;
            }
            else printf("Lose %d.  Total = %d.\n",t,T);
        }
    }
    return 0;
}

